package com.markedquilt.homepage.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

/**
 * @author ZhangKe
 * @Description homepage_user 表对应的实体类
 * @date 2020/12/27 18:35.
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@EntityListeners(AuditingEntityListener.class)
@Table(name = "homepage_user")
public class HomePageUser {
    /**
     * @GeneratedValue 生成策略：自增
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id",nullable = false)
    private Long id;

    /**
     * 课程名称
     */
    @Basic
    @Column(name = "username",nullable = false)
    private String userName;

    /**
     * 课程类型
     */
    @Basic
    @Column(name = "email",nullable = false)
    private String email;

    /**
     * 创建时间
     */
    @Basic
    @Column(name = "create_time",nullable = false)
    @CreatedDate
    private Date createTime;

    /**
     * 更新时间
     */
    @Basic
    @Column(name = "update_time",nullable = false)
    @LastModifiedDate
    private Date updateTime;

    public HomePageUser(String userName, String email) {
        this.userName = userName;
        this.email = email;
    }
}
